home *** CD-ROM | disk | FTP | other *** search
- /**********************************************************************\
-
- File: demo.c
-
- Purpose: This module handles demo initialization/shutdown and a
- dispatch for the graphic effects.
-
-
- MSG Demo -- graphic effects demonstration program
- Copyright (C) 1992-3 Mark Pilgrim & Dave Blumenthal
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program in a file named "GNU General Public License".
- If not, write to the Free Software Foundation, 675 Mass Ave,
- Cambridge, MA 02139, USA.
-
- \**********************************************************************/
-
- #include "demo.h"
- #include "msg graphics.h"
-
- PicHandle gPict1;
- PicHandle gPict2;
- PicHandle gPict3;
- PicHandle gPict4;
- Boolean gWhichPict;
- int gWhichWipe;
- int gLastWipe;
-
- void InitProgram(void)
- {
- gPict1 = GetPicture(200);
- gPict2 = GetPicture(201);
- gPict3 = GetPicture(202);
- gPict4 = GetPicture(203);
-
- gWhichWipe=0;
- gLastWipe=-1;
- gMainWindow=0L;
- gInitedWindowBounds=FALSE;
- OpenMainWindow();
- }
-
- void ShutDownProgram(void)
- {
- if(gPict1)
- ReleaseResource(gPict1);
- if(gPict2)
- ReleaseResource(gPict2);
- if(gPict3)
- ReleaseResource(gPict3);
- if(gPict4)
- ReleaseResource(gPict4);
- }
-
- void DemoDoWipe(GrafPtr myGrafPtr)
- {
- ObscureCursor();
- gWhichPict = !gWhichPict;
- switch(gWhichWipe)
- {
- case 1: BoxOutWipe(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 2: RandomWipe(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 3: SpiralGyra(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 4: CircularWipe(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 5: CasteWipeRL(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 6: FourCorner(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 7: BoxInWipe(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 8: RippleWipe(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 9: DissolveWipe(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 10: DiagonalWipe(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 11: CasteWipe(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 12: HilbertWipeCall(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 13: SlideWipe(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 14: Skipaline(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 15: SkipalineLR(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 16: Scissors(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 17: RescueRaiders(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 18: FourCornerCentered(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 19: TwoCorner(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 20: CircleOut(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 21: CircleIn(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 22: CircleSerendipity(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 23: CircleBulge(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 24: CornerCircle(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 25: FullScrollLR(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 26: FullScrollUD(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 27: MrDo(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 28: MrDoOutdone(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 29: SplitScrollUD(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 30: FourCornerScroll(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 31: HalvesScroll(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- case 32: PourScroll(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- default: CornerCircle(myGrafPtr, (GrafPtr)gMainWindow, gWindowHeight, gWindowWidth); break;
- }
- gLastWipe=gWhichWipe;
- gWhichWipe=0;
- }
-